package br.com.fidalgotecnologia.layar.json;

import org.json.JSONException;
import org.json.JSONObject;
import br.com.fidalgotecnologia.layar.entity.Object;



public class ObjectJson {
public static ObjectJson instance;
	
	public static ObjectJson getInstance() {
		if(instance==null){
			instance= new ObjectJson();
		}
		return instance;
	}
	
	public JSONObject toObject(Object object){
		JSONObject objectJson = new JSONObject();
		
		try {
			objectJson.put("baseURL",object.getBaseURL());
			objectJson.put("full",object.getFull());
			objectJson.put("reduced",object.getReduced());
			objectJson.put("icon",object.getIcon());
			objectJson.put("size",object.getSize());
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return objectJson;
	}
}
